package com.opencover.xterm;

import java.util.HashMap;
import java.util.Map;

import com.opencover.xterm.command.AddLastColors;
import com.opencover.xterm.command.NewTerm;
import com.opencover.xterm.command.NoOperation;
import com.opencover.xterm.command.RandTerm;
import com.opencover.xterm.command.XtermCommand;

public class XtermMain {

	private static final Map<String, XtermCommand> commands;

	static {
		commands = new HashMap<String, XtermCommand>();
		commands.put("newTerm", new NewTerm());
		commands.put("randTerm", new RandTerm());
		commands.put("addLastColors", new AddLastColors());
		commands.put("noop", new NoOperation());
	}

	public static void main(String[] args) {
		String command = System.getProperty("command", "noop");
		commands.get(commands.containsKey(command) ? command : "noop").execute();
	}
}
